import React from 'react';
import { connect } from 'dva';
import { routerRedux } from 'dva/router';
import { List, Icon, TextareaItem } from 'antd-mobile';
import content from '../../../common/contentCss/content.css';
import CustTitle from '../../../common/title/title';
import styles from './common.css';
import MyEducationListView from './pages/myEducationList';

// import UploadImg from './pages/uploadImg/uploadImg';

function MyEducationList({dispatch,loading,myEducationList,partTime}) {
  // const {  } = myEducationList
  const { jobList,pageNum } = partTime
  const titleProps = {
    titleName: '教育经历',
    goBack(){
      history.go(-1);
    }
  }


  function addEducation() {

  }
  const MyEducationListProps = {
    addEducation() {
      console.log('添加教育经历添加教育经历');
      dispatch(routerRedux.push({
        pathname: '/set-education',
      }))
    },
    loading,
    list: ['jobList','2'],
    onPutEducation(id){
      console.log('修改工作经历');
      dispatch(routerRedux.push({
        pathname: '/set-education',
        query: {
          id,
        }
      }));
    },
    onPagination() {
      // if (loading || JSON.stringify(list) == "[]") {
      //   return;
      // }

      return
      if (pageNum >= pages) {
        return;
      }
      dispatch({
        type: 'members/query',
        payload: {
          pageNum: pageNum + 1,
        }
      })
    }
  }


  const MarginHeight = () => <div style={{height: '0.6em', backgroundColor:'#F5F5F9'}}></div>;
      // <MyEducationListView  {...MyEducationListProps}/>
      // <div className={styles.addDIV} onClick={addEducation}> + 添加教育经历</div>

  return(
    <div className={content.content} style={{backgroundColor:'#fff'}}>
      <CustTitle {...titleProps}/>
      <div style={{
        marginTop: '2.8125em',
      }}>
      </div>
      <MyEducationListView  {...MyEducationListProps}/>
    </div>
  )
}

function mapStateToProps(state, ownProps) {
  return {
    myEducationList: state.myEducationList,
    partTime: state.partTime,
    loading: state.loading.global,
  }
}

export default connect(mapStateToProps)(MyEducationList);
